package cn.auction.biz.impl;

import cn.auction.biz.AuctionBiz;
import cn.auction.dao.AuctionDao;
import cn.auction.dao.impl.AuctionDaoImpl;
import cn.auction.entity.Auction;
import cn.auction.entity.AuctionPage;
import cn.auction.entity.Auctionrecord;
import cn.auction.entity.EndAuction;

import java.sql.SQLException;
import java.util.List;

public class AuctionBizImpl implements AuctionBiz {
    AuctionDao auctionDao=new AuctionDaoImpl();
    @Override
    public AuctionPage<Auction> showAllAuction(Auction condition, int pageIndex) throws SQLException {
        return auctionDao.showAllAuction(condition,pageIndex);
    }

    @Override
    public List<Auction> showAllAuctio(String newSql) throws SQLException {
        return auctionDao.showAllAuctio(newSql);
    }

    @Override
    public int AddAuction(Auction auction) throws SQLException {
        return auctionDao.AddAuction(auction);
    }

    @Override
    public Auction ShowAuctionById(int id) throws SQLException {
        return auctionDao.ShowAuctionById(id);
    }

    @Override
    public int UpdateAuction(Auction auction) throws SQLException {
        return auctionDao.UpdateAuction(auction);
    }

    @Override
    public int deleteAuction(int auctionId) throws SQLException {
        return auctionDao.deleteAuction(auctionId);
    }

    @Override
    public List<Auctionrecord> showAuctionrecord(int auctionId) throws SQLException {
        return auctionDao.showAuctionrecord(auctionId);
    }

    @Override
    public int AddAuctionrecord(int userId, int auctionId, double auctionPrice) throws SQLException {
        return auctionDao.AddAuctionrecord(userId, auctionId, auctionPrice);
    }

    @Override
    public List<EndAuction> showEndTimeAuction() throws SQLException {
        return auctionDao.showEndTimeAuction();
    }

    @Override
    public List<EndAuction> showAuctionNowTime() throws SQLException {
        return auctionDao.showAuctionNowTime();
    }

}
